package com.example.lj.uav.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class RoutePoint implements Parcelable {
    private int id;
    private double longitude;//经度
    private double latitude;//纬度
    private double altitude;//高度
    private String useWaylineAltitude;//高度模式
    private String direction;//飞行器旋转方向
    private double angle;//航偏角度
    private double pitchAngle;//俯仰角
    private String motion;//动作
    private List<PointAction> actions = new ArrayList<>();//动作集合

    public RoutePoint() {
    }

    public RoutePoint(double longitude, double latitude) {
        this.longitude = longitude;
        this.latitude = latitude;
    }

    protected RoutePoint(Parcel in) {
        id = in.readInt();
        longitude = in.readDouble();
        latitude = in.readDouble();
        altitude = in.readDouble();
        useWaylineAltitude = in.readString();
        direction = in.readString();
        angle = in.readDouble();
        pitchAngle = in.readDouble();
        motion = in.readString();
        actions = in.createTypedArrayList(PointAction.CREATOR);
    }

    public static final Creator<RoutePoint> CREATOR = new Creator<RoutePoint>() {
        @Override
        public RoutePoint createFromParcel(Parcel in) {
            return new RoutePoint(in);
        }

        @Override
        public RoutePoint[] newArray(int size) {
            return new RoutePoint[size];
        }
    };

    public List<PointAction> getActions() {
        return actions;
    }

    public void setActions(List<PointAction> actions) {
        this.actions = actions;
    }

    public String getUseWaylineAltitude() {
        return useWaylineAltitude;
    }

    public void setUseWaylineAltitude(String useWaylineAltitude) {
        this.useWaylineAltitude = useWaylineAltitude;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public double getAltitude() {
        return altitude;
    }

    public void setAltitude(double altitude) {
        this.altitude = altitude;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public double getAngle() {
        return angle;
    }

    public void setAngle(double angle) {
        this.angle = angle;
    }

    public double getPitchAngle() {
        return pitchAngle;
    }

    public void setPitchAngle(double pitchAngle) {
        this.pitchAngle = pitchAngle;
    }

    public String getMotion() {
        return motion;
    }

    public void setMotion(String motion) {
        this.motion = motion;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeDouble(longitude);
        parcel.writeDouble(latitude);
        parcel.writeDouble(altitude);
        parcel.writeString(useWaylineAltitude);
        parcel.writeString(direction);
        parcel.writeDouble(angle);
        parcel.writeDouble(pitchAngle);
        parcel.writeString(motion);
        parcel.writeTypedList(actions);
    }
}
